import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-04-07
 * Time: 8:34
 */
public class test {
    //猜数字游戏
    public static void main(String[] args) {
        Random random = new Random();
        int n = random.nextInt(100);
        System.out.println(n);
        while (true){
            Scanner scan = new Scanner(System.in);
            System.out.println("请输入猜测的数字：");
            int a = scan.nextInt();
            if(a > n){
                System.out.println("猜大了");
            } else if(a < n){
                System.out.println("猜小了");
            } else{
                System.out.println("猜对了");
                break;
            }
        }

    }
}

